<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:composite="http://java.sun.com/jsf/composite"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:faces="http://java.sun.com/jsf/composite/faces/components">
 
    <composite:interface>
    	<!-- Attributes for formItem -->
    	<composite:attribute name="id" type="java.lang.String"/>
	   	<composite:attribute name="label" type="java.lang.String"/>
	   	<composite:attribute name="styleClass" type="java.lang.String"/>
	   	<composite:attribute name="style" type="java.lang.String"/>
	   	<composite:attribute name="labelStyleClass" type="java.lang.String"/>
	   	<composite:attribute name="labelStyle" type="java.lang.String"/>
	   	<composite:attribute name="caption" type="java.lang.String"/>
	   	<composite:attribute name="captionType" type="java.lang.String"/>
	   	
	   	<!-- Attributes for inputItem -->
    	<composite:attribute name="inputStyleClass" type="java.lang.String"/>
    	<composite:attribute name="disabled" type="java.lang.Boolean" default="false"/>
    	<composite:attribute name="readonly" type="java.lang.Boolean" default="false"/>
    	<composite:attribute name="items" type="java.util.Collection"/>
    	<composite:attribute name="itemLabel" type="java.lang.String"/>
    	<composite:attribute name="itemValue" type="java.lang.String"/>
    	<composite:attribute name="noSelectionLabel" type="java.lang.String"/>
    	<composite:editableValueHolder name="input" targets="input"/>
    	<composite:attribute name="value"/>
    	<composite:attribute name="required" type="java.lang.Boolean" default="false"/>
    </composite:interface>
 
    <composite:implementation>
    	<ui:decorate template="/faces/template/formItem.xhtml">
    		<ui:param name="cc" value="#{cc}" />
		   	<h:selectOneMenu styleClass="#{cc.attrs.inputStyleClass}" label="#{cc.attrs.label}" 
    			id="input" disabled="#{cc.attrs.disabled}"  value="#{cc.attrs.value}"
    			readonly="#{cc.attrs.readonly}" style="#{cc.attrs.inputStyle}">
    			<c:if test="#{not empty cc.attrs.converterId}">
	    			<f:converter converterId="#{cc.attrs.converterId}"/>
    			</c:if>
    			<c:if test="#{not empty cc.attrs.noSelectionLabel}">
	      			<f:selectItem itemValue="#{null}" itemLabel="#{cc.attrs.noSelectionLabel}"/>
    			</c:if>
    			<f:selectItems value="#{cc.attrs.items}" var="item" 
    				itemLabel="#{item[cc.attrs.itemLabel]}" itemValue="#{item[cc.attrs.itemValue]}"/>
         	</h:selectOneMenu>
         	<rich:message style="display:inline" rendered="#{systemConfig.config.getBoolean('validateMessageAfterInput',true)}" for="input"/>
    	</ui:decorate>
    </composite:implementation>
</ui:composition>